package
{
	import flash.events.Event;
	
	public class ClientEvent extends Event
	{
		public static const LOAD_DATA_FAILED:String = "loadDataFailed";
		public static const DECODE_DATA_FAILED:String = "decodeDataFailed";
		public static const LOGIN_COMPLETE:String = "loginComplete";
		public static const LOGIN_FAILED:String = "loginFailed";
		public static const QUERY_USER_COMPLETE:String = "queryUserComplete";
		public static const CREAT_ITEM_COMPLETE:String = "creatItemComplete";
		public static const UPDATE_LOCATION_COMPLETE:String = "updateLocationComplete";
		public static const GET_ITEM_COMPLETE:String = "getItemComplete";
		public static const ADD_USER:String = "addUser";
		public static const UPDATE_USER:String = "updateUser";
		
		private var _data:*;
		private var _message:String;
		public function ClientEvent(type:String, message:String="", data:*=null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			_data = data;
			if(message == "") message = ClientMessage.NO_MESSAGE;
			_message = message;
			super(type, bubbles, cancelable);
		}
		
		override public function clone():Event
		{
			return new ClientEvent(this.type,this.message,this.data,this.bubbles,this.cancelable);
		}
		
		public function get data():*
		{
			return _data;
		}
		
		public function get message():String
		{
			return _message;
		}
	}
}